function createChart(option) {
    //处理默认值
    if (!option.containerid) {
        alert("containerid is null")
        return;
    }
    //add by wanghuawen
    if ("undefined" == typeof Ext.getCmp(option.containerid)) {
        option.containerid = suunCore.GetParentExtWindowId($('span[name="suunViewWinTitle"]:last')[0]);
    }

    option.url = option.url || {};
    //是否阻止年份下拉框自动加载，默认为false,不阻止
    //重要：当在工具栏自定义配置下拉框需要从后台取数据时，才配置此属性，自定义的数据加载成功后，再触发年份下拉框数据加载，实现联动，最后由年份选择框来loadChart
    option.preventYearLoad = true == option.preventYearLoad;
    option.condition = option.condition || {};
    option.condition.extend=option.condition.extend || [];

    //给页面添加div，渲染工具栏和图表元素
    Ext.getCmp(option.containerid).update('<div id="' + option.containerid + '-Tbar"></div>'
                                        + '<div id="' + option.containerid + '-ChartDiv" style="height:500px;"></div>')

    //年份下拉框
    var yearCombo = new Ext.form.ComboBox({
        fieldLabel : '年份',
        xtype : "combo",
        typeAhead: true,
        triggerAction: 'all',
        lazyRender:true,
        mode: 'local',
        allowBlank:false,
        autoSelect:true,
        store: new Ext.data.Store({
            url: $ctx + '/common/extStore/getYear',
            autoLoad: !option.preventYearLoad,
            reader : new Ext.data.JsonReader({}, [{
                name : 'year',
                type : 'string'
            },{
                name : 'yearName',
                type : 'string'
            }]),
            listeners:{
                load: function(){
                    //取第一条默认数据
                    //var record = this.getAt(0);
                    //yearCombo.setValue(record.data['year']);

                    //取当前年数据
                    yearCombo.setValue(new Date().getFullYear());
                    formpanel.find('name','count')[0].fireEvent("click");
                }
            }
        }),
        hiddenName: 'year',
        valueField :'year',
        displayField: 'yearName'
    });

    //搜索条件
    var condition = [{items:yearCombo}];

    for(var i=0;i<option.condition.extend.length;i++){
        condition.push({items:option.condition.extend[i]});
    }

    //操作按钮
    var buttons = [{
        xtype : "button",
        text : "统计",
        name : 'count',
        iconCls : "search",
        style:'margin-left:10px;',
        width:50,
        listeners:{
            click:function(){
                if(formpanel.form.isValid()){
                    var data = formpanel.form.getValues();
                    ChartUtils.loadChart(option.containerid + '-ChartDiv', option.url,data);
                }
            }
        }
    },{
        xtype : "button",
        text : "重置",
        iconCls : "reset",
        style:'margin-left:15px;',
        width:50,
        handler : function() {
            formpanel.form.reset();
        }
    }];

    //图表工具栏
    var formpanel = new Ext.FormPanel({
        border : false,
        layout : "hbox",
        renderTo : option.containerid + "-Tbar",
        bodyStyle:'margin-top:5px;',
        defaults:{
            layout:'form',
            border:false,
            labelAlign:'right',
            labelWidth:60,
            width:260,
            defaults:{
                labelStyle:'margin-top:-5px;',
                xtype:'textfield'
            }
        }
    });

    formpanel.add(condition);
    formpanel.add(buttons);
    formpanel.doLayout();

    return formpanel;
}